package demo1;

class Rect extends Shape{

    @Override
    public void draw() {
        System.out.println("画矩形");
    }
}
class Cycle extends Shape {
    @Override
    public void draw() {
        System.out.println("画圆圈");
    }
}

class Flower extends Shape {
    @Override
    public void draw() {
        System.out.println("画❀");
    }
}
abstract class Person {
    public String name;
    public int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
}
class Student extends Person {
    public Student() {
        super("沸羊羊",10);
    }
}

public class Test {
    public static void func(Shape shape){
        shape.draw();
    }
    public static void main(String[] args) {
      /* (1)Rect rect = new Rect();
       func(rect);*/
      // func(new Rect());
       func(new Cycle());
       func(new Rect());
       func(new Flower());
    }
}

